<div class="overflow-x-auto">

    <div role="alert" class="alert shadow-lg">
        <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" class="stroke-info shrink-0 w-6 h-6"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"></path></svg>
        <div>
            <h3 class="font-bold">您共计 <span class="text-red-500 font-bold">{{ $auditCount }}</span> 条借阅需要审核!</h3>
        </div>
    </div>
    <table class="table table-zebra">
        <!-- head -->
        <thead>
        <tr>
            <th>书籍名称</th>
            <th>借阅人</th>
            <th>借阅时间</th>
            <th>归还时间</th>
            <th>逾期</th>
            <th>操作</th>
        </tr>
        </thead>
        <tbody>
        @foreach($data as $item)
            <tr class>
                <th class="flex items-center gap-2"><img width="40px" src="{{ $item->book->cover }}"
                                                         alt=""/> {{ $item->book->title }}</th>
                <th> {{ $item->user->nickname }}</th>
                <th> {{ $item->borrow_date }}</th>
                <th> {{ $item->return_date }}</th>
                <th> {{ $item->illegal }}</th>
                <th class="">
                    <form action="/audit" method="post">
                        <input type="hidden" name="id" value="{{ $item->id }}">
                        @csrf
                        <input type="hidden" name="type" value="1">
                        <button class="btn btn-xs btn-primary">同意</button>
                    </form>

                    <form action="/audit" class="mt-2" method="post">
                        <input type="hidden" name="id" value="{{ $item->id }}">
                        @csrf
                        <input type="hidden" name="type" value="2">
                        <button class="btn btn-xs btn-danger">拒绝</button>
                    </form>


                </th>
            </tr>
        @endforeach

        </tbody>
    </table>
    @if(count($data) == 0)
        <div class="mt-10">
            @include('tool.empty')
        </div>
    @endif

    {{ $data->links() }}
</div>
